/*
 * @Descripttion: 
 * @Author: cuidm
 * @Date: 2022-07-14 15:10:40
 * @LastEditors: cuidm
 * @LastEditTime: 2022-09-26 14:28:07
 */
import G6 from '@antv/g6';
// 默认节点配置
export const defaultNodeConfig = {
    type: 'leaf-node',
    size: 30,
    style: {
        cursor: 'pointer',
        fill: '#3056E3',
        shadowColor: '#1b47ea',
        shadowBlur: 1,
        fillOpacity: 0.5,
    },
    icon: {
        fontFamily: 'iconfont',
        fill: '#ffffff',
        show: true,
        fontSize: 16
    },
    labelCfg: {//字体样式
        position: 'bottom',
        offset: 10,
        style: {
            fill: '#666',
            fontSize: 12,
        },
    },
    anchorPoints: [
        [0, 0.5],
        [0.5, 0],
        [1, 0.5],
        [0.5, 1],
    ]
}
// 默认线条配置
export const defaultEdgeConfig = {
    type: 'can-running',
    style: {
        stroke: '#3056E3',
        strokeOpacity: 1,
        lineWidth: 1.5,
        lineAppendWidth: 3,
        endArrow: { 
            path: G6.Arrow.triangle(8, 8, 0),
            fill: '#3056E3',
        },
    },
    labelCfg: {
        autoRotate: true,
        style: {
            fontSize: 12,
            fontWeight: 400,
            fill: '#c2c2c2',
            background: {
                fill: '#fff',
                // stroke: '#3056E3',
                padding: [2, 2, 2, 2],
                radius: 2,
                lineWidth: 1,
                zIndex: 1
            },
        }
    }
};

export const defaultLayout = {
    // type: 'concentric',
    // maxLevelDiff: 0.5,
    // nodeSize: 80,
    // preventOverlap: true,
    // sortBy: 'moduleClassificationId',
    type: 'dagre',
    rankdir: 'BT',
    nodesepFunc: () => 30,
    ranksepFunc: () => 60,
}